<template>
  <a-form-model
    class="form"
    :model="form"
    :label-col="labelCol"
    :wrapper-col="wrapperCol"
  >
    <section-title>基本信息</section-title>
    <a-form-model-item label="年份" required>
      <a-input v-model="form.name" placeholder="" />
    </a-form-model-item>
    <a-form-model-item label="所属上级" required>
      <s-select :selectOption="year" v-model="form.strYear" />
    </a-form-model-item>
    <a-form-model-item label="名称" required>
      <a-input v-model="form.name" placeholder="" />
    </a-form-model-item>
    <a-form-model-item label="编号" required>
      <a-input v-model="form.name" placeholder="" />
    </a-form-model-item>
    <a-form-model-item label="状态" required>
      <a-radio-group :options="plainOptions" v-model="form.type" />
    </a-form-model-item>
    <a-form-model-item label="序号" required>
      <s-select :selectOption="year" v-model="form.strYear" />
    </a-form-model-item>

    <a-form-model-item :wrapper-col="{ span: 20, offset: 4 }">
      <a-button type="primary" @click="onSubmit"> 确定 </a-button>
      <a-button style="margin-left: 10px" @click="$router.back()">
        返回
      </a-button>
    </a-form-model-item>
  </a-form-model>
</template>
<script>
import sectionTitle from 'components/base/sectionTitle'
export default {
  data() {
    return {
      labelCol: { span: 2 },
      wrapperCol: { span: 14 },
      plainOptions: [
        { label: '正常', value: '1' },
        { label: '禁用', value: '0' }
      ],
      form: {
        name: undefined,
        region: undefined,
        date1: undefined,
        delivery: false,
        type: undefined,
        resource: '',
        desc: ''
      },
      year: [
        { key: '2021', label: '2021' },
        { key: '2020', label: '2020' }
      ]
    }
  },
  components: { sectionTitle },
  methods: {
    onSubmit() {
      console.log('submit!', this.form)
    }
  }
}
</script>